#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void  FIND_point(int arr[5][20],int n)
{
	int i = 0;
	int j = 0;
	for (i; i < n; i++)
	{
		j = 0;
		while (arr[i][j] != 0)
		{
			if (j == 0 || arr[i][j+1]==0)
			{
				if (j == 0)
				{
					if (arr[i][j] != arr[i][j + 1])
						printf("%d ", j);
				}
				else
				{
					if (arr[i][j] != arr[i][j - 1])
						printf("%d ", j);
				}
			}
			else
			{
				if (arr[i][j] > arr[i][j + 1] && arr[i][j] > arr[i][j - 1])
					printf("%d ", j);
				else if (arr[i][j] < arr[i][j + 1] && arr[i][j] < arr[i][j-1])
					printf("%d ", j);
			}
			j++;
		}
		printf("\n");
	}
}
int main()
{
	int arr[5][20] = { 0};
	int n = 0;
	int l = 0;
	int m = 0;
	int x = 0;
	scanf("%d", &n);
	while (m<n)
	{
		int i = 0;
		scanf("%d", &x);
		for (i; i < x; i++)
		{
			scanf("%d", &arr[m][i]);
		}
		m++;
	}
	FIND_point(arr,n);
	return 0;
}